#ifndef QUATERNION
#define QUATERNION

#include "Vector3D.h"
#include "Matrix.h"

class Quaternion {
private:
	Quaternion getConjugate() const;
	void normalize();
	float dot(const Quaternion& a) const;
public:
	float x, y, z, w;

	Quaternion(float x, float y, float z, float w);
	Quaternion(const Vector3D& v, float angle);
	Quaternion();
	void setByAxisAngle(const Vector3D& v, float angle);
	Quaternion operator* (const Quaternion &rq) const;
	Vector3D rotateVector(const Vector3D &vec) const;
	void nlerp(const Quaternion& a, const Quaternion& b, float t);
	void slerp(const Quaternion& a, const Quaternion& b, float t);
	Vector3D getDirectionVector();
	Matrix getMatrix() const;
	Quaternion operator* (float scalar) const;
	Quaternion operator+ (const Quaternion& quaternion) const;
	
	static Quaternion getRotationAroundYAxis(float angle);
};

#endif